{{ content() }}
<div id="dialog" title="Basic dialog" style="display: none;">
</div>
<section id="main">
    <div class="alluser_title">
        <h2>
            Thành viên	<a href="{{url('admin/add_user')}}" class="add-new-h2">Add New</a>
        </h2>
    </div>
    <div class="" style="margin: 20px auto; width: 1050px">
        {{form('id':'adminForm')}}
        <div>
            <select name="action" id="action">
                <option value="-1" selected="selected">Tác vụ</option>
                <option value="add">Thêm</option>
                <option value="edit" class="hide-if-no-js">Chỉnh sửa</option>
                <option value="trash">Xóa</option>
            </select>       
            <span class="button action"><a name="" id="actionbtn" style="color:#666">Áp dụng</a></span>
            {{form.render('role')}}  
            <button class="button">Lọc</button>
            <div class="search">
                {{form.render('text')}} 
                <button class="button">Search Users</button>
            </div>
        </div>
        <div class="fright_pagination">
            {{form.render('page')}}
            {{form.render('limit',['onchange':'adminForm.submit()'])}}
            {{form.render('orderby')}}
            {{elements.paginator(users,'adminForm')}}
        </div>
        {{endform()}}
    </div>    
    <article class="manage_user module">
        <header>
            <h3 class="tabs_involved">Quản lý User </h3>                       
        </header>

        <div class="tab_container">
            <div class="tab_content">
                <table class="tablesorter alluser_table" cellspacing="0"> 
                    <thead> 
                        <tr> 
                            <th></th> 
                            <th class="column1">Username</th>                                 
                            <th class="column2">Email</th> 
                            <th class="column3">Full name</th>                                 
                            <th class="column4">Address </th> 
                            <th class="column5">ePoints</th>
                            <th class="column6">Balance</th>
                            <th class="column7">Role</th>
                            <th class="column8">Action</th>
                        </tr>                       
                    </thead> 
                    <tbody>
                        {% for user in users.items %}
                        <tr> 
                            <td><input class="item" type="checkbox"  data-id="{{user.id}}" name="checkbox[]"></td>
                            <td>{{user.username}}</td>     
                            <td>{{user.email}}</td> 
                            <td>{{user.fullName}}</td> 
                            <td>{{user.address}}</td> 
                            <td> {{user.points}}</td>
                            <td>{{user.balance}}</td>
                            <td>{{user.role_id}}</td>
                            <td ><a href="{{url('admin/edit_user/'~user.id)}}"><img src="{{url('css/admin/images/icn_edit.png')}}" title="Edit"></a>&nbsp;&nbsp;<a id="delete" class="deletebtn" data-id="{{user.id}}"><img src="{{url('css/admin/images/icn_trash.png')}}" title="Xóa"></a></td> 
                        </tr> 
                        {% endfor %}                       
                    </tbody> 
                </table>
            </div><!-- end of #tab1 -->
        </div><!-- end of .tab_container -->
    </article><!-- end of content manager article --> 

</section>
{{javascript_include('js/admin/users.js')}}

